package com.hurl.stock.testcase;

import java.util.List;

import org.hibernate.Criteria;
import org.testng.annotations.Test;

import com.hurl.stock.persistence.DmGpBO;
import com.hurl.stock.persistence.DmGplxBO;
import com.hurl.stock.util.HibernateExecutor;
import com.hurl.stock.util.HibernateUtils;

public class Hibernate_TestCase {
	@Test
	public void test_query(){
		HibernateExecutor exec = HibernateUtils.createExecutor();
		exec.beginTransaction();
		Criteria c = exec.createCriteria(DmGpBO.class);
		List<DmGpBO> list = c.list();
		assert list.size()>0;
//		HibernateExecutor exec = HibernateUtils.createExecutor();
//		exec.beginTransaction();
//		//Criteria c = exec.createCriteria(DmGplxBean.class);
//		JcsjSinaSssjBean bean = new JcsjSinaSssjBean();
//		bean.setGpmc("股票名称");
//		exec.save(bean);
//		exec.commit();
	}
}
